import './styles/index.scss'
import 'virtual:svg-icons-register'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap'

import '@ag/design/theme.scss'
import '@ag/design/style.scss'

import ElementPlus from 'element-plus'

import App from './App.vue'

import Echarts from './plugins/echarts'
import ElementIcons from './plugins/element-icons'
import AgDesign from './plugins/ag-design/index'

const isServe = import.meta.env.MODE === 'development'
// !isServe &&
//   (window._AMapSecurityConfig = {
//     serviceHost: window[import.meta.env.VUE_APP_CONFIG as string]._AMapProxyURL
//   })
// console.log('import.meta.env', import.meta.env)


// 初始化vue-amap
initAMapApiLoader({
    // 高德的key
    key: isServe
      ? '98268680341c5d6fe3d79c13a8ace504'
      : 'd5fdf7c41007201b3bdc5dc9cff1dd56',
  //   securityJsCode: 'securityJsCode', // 新版key需要配合安全密钥使用
    version: '2.0'
    //Loca:{
    //  version: '2.0.0'
    //} // 如果需要使用loca组件库，需要加载Loca
  })

const app = createApp(App)

app.use(createPinia())
app.use(ElementPlus)
app.use(ElementIcons)
app.use(Echarts)
app.use(AgDesign)
app.use(VueAMap)
